/**
 * 
 */
package com.hexacta.hrs.repositories.impl;

import java.util.Collection;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.hexacta.hrs.securitygroups.SecurityPage;

/**
 * Repositorio de Security Pages
 * 
 * @author pgoette
 * 
 */
public class SecurityPagesRecordObjectRepository extends HibernateRecordObjectRepository<SecurityPage> {

    /** {@inheritDoc} */
    public SecurityPagesRecordObjectRepository(Class<SecurityPage> entityClass) {
        super(entityClass);
    }

    @Override
    public Collection<SecurityPage> matching(SecurityPage criteria) {
        Criteria crit = getSession().createCriteria(SecurityPage.class);
        if (criteria.getUrl() != null) {
            crit.add(Restrictions.eq("url", criteria.getUrl()));
        }
        return crit.list();
    }

}